/**
 * Created by LMN on 2016/7/20.
 * Use jpush to push message to APPs.
 */
var request = require('request');
module.exports = {
    android: function(msg, phones){
        var data = {
            'platform': ['android'],
            'audience': 'all',
            'notification':{
                'android': {
                    'alert': msg+'',
                    'title': phones+''
                }
            }
        };
        request({
            url: 'https://api.jpush.cn/v3/push',
            method: 'post',
            headers: {
                'Content-Type' : 'application/json',
                'Authorization': 'Basic ZmQ3NjJhNTBiZWMzNzZhYTExNjhhMGRkOjJmM2RlZjcyMjFlZWZiYWFhMjJkZjM1OQ=='
            },
            form: JSON.stringify(data)
        },function(e,r,body){

        });
    }
};